package com.smart.gaorenhui;

import com.smart.gaorenhui.task.MyHandler;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author Administrator
 */
@Component
@Log4j2
@RequiredArgsConstructor
public class AutoTask {
    @Scheduled(cron = "0 44 1 * * ? ")
    public void  begin(){
        log.warn("开始执行数据采集");
        MyHandler myHandler1 = new MyHandler();
        myHandler1.run();
        log.warn("数据采集完成");

    }
}
